param(
	[string] $url = $(Read-Host -prompt "Enter Base Url"),
	[string] $path = $(get-location),
	[string] $configuration = $("FullBuild")
)

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue | Out-Null

Write-host Build Site - $configuration

$url = $url.TrimEnd('/')

write-host "Url - $url"
write-host "Path - $path"
write-host "Configuration - $configuration"

#region functions

function CreateSite([string] $baseUrl, [string]$basePath)
{
    . "$basePath\lib\new site.ps1" -url "$baseUrl" -template "BLANKINTERNET#1"
    Enable-SPFeature -url $baseUrl -identity a8e4e009-5ff0-45d7-a7b8-556d3a1c378f
	Enable-SPFeature -url $baseUrl -identity 178da465-8e2b-459c-a6a9-c56dac129851
}

#endregion

switch($configuration)
{
    "FullBuild"
    {
        CreateSite -baseUrl $url -basePath $path
    }
    default
    {
        exit
    }
}

